package nowcoder;
/**
 * 统计回文
 * 链接：https://www.nowcoder.com/practice/9d1559511b3849deaa71b576fa7009dc?tpId=85&&tqId=29
 * 842&rp=1&ru=/activity/oj&qru=/ta/2017test/question-ranking
 */
import java.util.*;
public class Day05_1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String a = input.next();
        String b = input.next();

        List<String> list = new ArrayList<>();
        // a的第一个字符之前添加
        StringBuilder sb = new StringBuilder(b + a);
        list.add(sb.toString());

        // a的每个字符之后添加
        for (int i = 0; i < a.length(); i++) {
            //清空sb
            sb.delete(0, sb.length());
            //开始拼接
            sb.append(a.substring(0, i + 1));
            sb.append(b);
            sb.append(a.substring(i + 1, a.length()));
            list.add(sb.toString());
        }

        //遍历每个字符串判断是否回文
        int count = 0;
        for (int i = 0; i < list.size(); i++) {
            if(isMirror(list.get(i))){
                count ++;
            }
        }
        System.out.println(count);
    }

    //判断字符串是否回文
    private static boolean isMirror(String s) {
        StringBuilder sb = new StringBuilder(s);
        String s2 = sb.reverse().toString();
        return s.equals(s2);
    }
}
